/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package warmachinesystem.util;

import java.util.List;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;

import warmachinesystem.*;
import warmachinesystem.ArmyList;
import warmachinesystem.BaseUnit;
import warmachinesystem.GameSystem;
import warmachinesystem.Solo;
import warmachinesystem.SpecialRule;
import warmachinesystem.TierLevel;
import warmachinesystem.TierList;
import warmachinesystem.Unit;
import warmachinesystem.UnitAttachment;
import warmachinesystem.UnitRule;
import warmachinesystem.Warcaster;
import warmachinesystem.Warjack;
import warmachinesystem.WarmachineSystemPackage;

/**
 * <!-- begin-user-doc -->
 * The <b>Switch</b> for the model's inheritance hierarchy.
 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
 * to invoke the <code>caseXXX</code> method for each class of the model,
 * starting with the actual class of the object
 * and proceeding up the inheritance hierarchy
 * until a non-null result is returned,
 * which is the result of the switch.
 * <!-- end-user-doc -->
 * @see warmachinesystem.WarmachineSystemPackage
 * @generated
 */
public class WarmachineSystemSwitch<T> {
	/**
	 * The cached model package
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected static WarmachineSystemPackage modelPackage;

	/**
	 * Creates an instance of the switch.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public WarmachineSystemSwitch() {
		if (modelPackage == null) {
			modelPackage = WarmachineSystemPackage.eINSTANCE;
		}
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	public T doSwitch(EObject theEObject) {
		return doSwitch(theEObject.eClass(), theEObject);
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	protected T doSwitch(EClass theEClass, EObject theEObject) {
		if (theEClass.eContainer() == modelPackage) {
			return doSwitch(theEClass.getClassifierID(), theEObject);
		}
		else {
			List<EClass> eSuperTypes = theEClass.getESuperTypes();
			return
				eSuperTypes.isEmpty() ?
					defaultCase(theEObject) :
					doSwitch(eSuperTypes.get(0), theEObject);
		}
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	protected T doSwitch(int classifierID, EObject theEObject) {
		switch (classifierID) {
			case WarmachineSystemPackage.GAME_SYSTEM: {
				GameSystem gameSystem = (GameSystem)theEObject;
				T result = caseGameSystem(gameSystem);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.ARMY_LIST: {
				ArmyList armyList = (ArmyList)theEObject;
				T result = caseArmyList(armyList);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.BASE_UNIT: {
				BaseUnit baseUnit = (BaseUnit)theEObject;
				T result = caseBaseUnit(baseUnit);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.WARCASTER: {
				Warcaster warcaster = (Warcaster)theEObject;
				T result = caseWarcaster(warcaster);
				if (result == null) result = caseBaseUnit(warcaster);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.WARJACK: {
				Warjack warjack = (Warjack)theEObject;
				T result = caseWarjack(warjack);
				if (result == null) result = caseBaseUnit(warjack);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.UNIT: {
				Unit unit = (Unit)theEObject;
				T result = caseUnit(unit);
				if (result == null) result = caseBaseUnit(unit);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.SOLO: {
				Solo solo = (Solo)theEObject;
				T result = caseSolo(solo);
				if (result == null) result = caseBaseUnit(solo);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.UNIT_ATTACHMENT: {
				UnitAttachment unitAttachment = (UnitAttachment)theEObject;
				T result = caseUnitAttachment(unitAttachment);
				if (result == null) result = caseBaseUnit(unitAttachment);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.SPECIAL_RULE: {
				SpecialRule specialRule = (SpecialRule)theEObject;
				T result = caseSpecialRule(specialRule);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.UNIT_RULE: {
				UnitRule unitRule = (UnitRule)theEObject;
				T result = caseUnitRule(unitRule);
				if (result == null) result = caseSpecialRule(unitRule);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.TIER_LIST: {
				TierList tierList = (TierList)theEObject;
				T result = caseTierList(tierList);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.TIER_LEVEL: {
				TierLevel tierLevel = (TierLevel)theEObject;
				T result = caseTierLevel(tierLevel);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.TIER_REQUIREMENT: {
				TierRequirement tierRequirement = (TierRequirement)theEObject;
				T result = caseTierRequirement(tierRequirement);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.TR_UNIT_TYPE: {
				TRUnitType trUnitType = (TRUnitType)theEObject;
				T result = caseTRUnitType(trUnitType);
				if (result == null) result = caseBaseUnitTierElement(trUnitType);
				if (result == null) result = caseTierRequirement(trUnitType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.TR_NO_UNIT_TYPE: {
				TRNoUnitType trNoUnitType = (TRNoUnitType)theEObject;
				T result = caseTRNoUnitType(trNoUnitType);
				if (result == null) result = caseTRUnitType(trNoUnitType);
				if (result == null) result = caseBaseUnitTierElement(trNoUnitType);
				if (result == null) result = caseTierRequirement(trNoUnitType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.TIER_BENEFIT: {
				TierBenefit tierBenefit = (TierBenefit)theEObject;
				T result = caseTierBenefit(tierBenefit);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.BASE_UNIT_TIER_ELEMENT: {
				BaseUnitTierElement baseUnitTierElement = (BaseUnitTierElement)theEObject;
				T result = caseBaseUnitTierElement(baseUnitTierElement);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.TB_FREE_UNIT: {
				TBFreeUnit tbFreeUnit = (TBFreeUnit)theEObject;
				T result = caseTBFreeUnit(tbFreeUnit);
				if (result == null) result = caseBaseUnitTierElement(tbFreeUnit);
				if (result == null) result = caseTierBenefit(tbFreeUnit);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.TB_FIELD_ALLOWANCE_DELTA: {
				TBFieldAllowanceDelta tbFieldAllowanceDelta = (TBFieldAllowanceDelta)theEObject;
				T result = caseTBFieldAllowanceDelta(tbFieldAllowanceDelta);
				if (result == null) result = caseBaseUnitTierElement(tbFieldAllowanceDelta);
				if (result == null) result = caseTierBenefit(tbFieldAllowanceDelta);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.TB_FIELD_ALLOWANCE_RELATIVE_DELTA: {
				TBFieldAllowanceRelativeDelta tbFieldAllowanceRelativeDelta = (TBFieldAllowanceRelativeDelta)theEObject;
				T result = caseTBFieldAllowanceRelativeDelta(tbFieldAllowanceRelativeDelta);
				if (result == null) result = caseTBFieldAllowanceDelta(tbFieldAllowanceRelativeDelta);
				if (result == null) result = caseBaseUnitTierElement(tbFieldAllowanceRelativeDelta);
				if (result == null) result = caseTierBenefit(tbFieldAllowanceRelativeDelta);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.TB_POINT_COST_DELTA: {
				TBPointCostDelta tbPointCostDelta = (TBPointCostDelta)theEObject;
				T result = caseTBPointCostDelta(tbPointCostDelta);
				if (result == null) result = caseBaseUnitTierElement(tbPointCostDelta);
				if (result == null) result = caseTierBenefit(tbPointCostDelta);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case WarmachineSystemPackage.TB_IN_GAME_RULE: {
				TBInGameRule tbInGameRule = (TBInGameRule)theEObject;
				T result = caseTBInGameRule(tbInGameRule);
				if (result == null) result = caseTierBenefit(tbInGameRule);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			default: return defaultCase(theEObject);
		}
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Game System</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Game System</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseGameSystem(GameSystem object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Army List</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Army List</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseArmyList(ArmyList object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Base Unit</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Base Unit</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseBaseUnit(BaseUnit object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Warcaster</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Warcaster</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseWarcaster(Warcaster object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Warjack</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Warjack</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseWarjack(Warjack object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Unit</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Unit</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseUnit(Unit object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Solo</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Solo</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseSolo(Solo object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Unit Attachment</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Unit Attachment</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseUnitAttachment(UnitAttachment object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Special Rule</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Special Rule</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseSpecialRule(SpecialRule object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Unit Rule</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Unit Rule</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseUnitRule(UnitRule object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Tier List</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Tier List</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseTierList(TierList object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Tier Level</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Tier Level</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseTierLevel(TierLevel object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Tier Requirement</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Tier Requirement</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseTierRequirement(TierRequirement object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>TR Unit Type</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>TR Unit Type</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseTRUnitType(TRUnitType object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>TR No Unit Type</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>TR No Unit Type</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseTRNoUnitType(TRNoUnitType object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Tier Benefit</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Tier Benefit</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseTierBenefit(TierBenefit object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Base Unit Tier Element</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Base Unit Tier Element</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseBaseUnitTierElement(BaseUnitTierElement object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>TB Free Unit</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>TB Free Unit</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseTBFreeUnit(TBFreeUnit object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>TB Field Allowance Delta</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>TB Field Allowance Delta</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseTBFieldAllowanceDelta(TBFieldAllowanceDelta object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>TB Field Allowance Relative Delta</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>TB Field Allowance Relative Delta</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseTBFieldAllowanceRelativeDelta(TBFieldAllowanceRelativeDelta object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>TB Point Cost Delta</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>TB Point Cost Delta</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseTBPointCostDelta(TBPointCostDelta object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>TB In Game Rule</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>TB In Game Rule</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseTBInGameRule(TBInGameRule object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch, but this is the last case anyway.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
	 * @generated
	 */
	public T defaultCase(EObject object) {
		return null;
	}

} //WarmachineSystemSwitch
